<html>
<head>
<script src="../../main/resources/net/pimpas/web/jsf/components/js/pimpas/pimpas.js"></script>
<script>
// detect
pimpas.RequireJS( 'detect.js' );
// timer
pimpas.RequireJS( 'timer.js' );
// interval
pimpas.RequireJS( 'interval.js' );
// listener
pimpas.RequireJS( 'listener.js' );
// log
pimpas.RequireJS( 'log.js' );
// firebug
pimpas.RequireJS( 'firebug.js' );
// dom
pimpas.RequireJS( 'dom.js' );
// dom event
pimpas.RequireJS( 'event.js' );
// httprequest
pimpas.RequireJS( 'httpRequest.js' );
// ajax
pimpas.RequireJS( 'ajax.js' );
// ajaxpopulate
pimpas.RequireJS( 'ajaxPopulate.js' );
// input
pimpas.RequireJS( 'populate/input.js' );
// select
pimpas.RequireJS( 'populate/select.js' );
// radio
pimpas.RequireJS( 'populate/radio.js' );
// checkbox
pimpas.RequireJS( 'populate/checkbox.js' );
// html
pimpas.RequireJS( 'populate/html.js' );
// xml
pimpas.RequireJS( 'xml.js' );
// xpath
pimpas.RequireJS( 'xpath.js' );
// json
pimpas.RequireJS( 'json.js' );
// control
pimpas.RequireJS( 'control/ajaxControl.js');
// utils
pimpas.RequireJS( 'utils/ajaxUtils.js');
// cleanup
pimpas.RequireJS( 'cleanup.js');
</script>
<style>
.classLoading {
	position: absolute;
	width: 100px;
	height: 20px;
	display: block;
	background-color: pink;
	left: 1180px;
	font-style:oblique;
}
</style>
</head>
<body>
<script>
HTTPRequestPool.init( 10 );
// install log in firebug console
pimpas.FireBug.installLogInConsole( );
var listener = new pimpas.HTTPRequest.Listener();
pimpas.Extends(listener,
	{
		callBack: function(obj, evt, text, xmlObject, xmlDocument) {
			switch( evt ) {
				case pimpas.HTTPRequest.events.onComplete:
					alert(text);
				break;			
			}
		}
	}
);

function makeRequest() {
	
	var req = pimpas.AJAX.getInstance();
	//var req = new pimpas.HTTPRequest();
	req.setUrl('info.xml');
	req.addParameter('user', 1);
	req.addParameter('type', 2);
	req.setRequestMethod(pimpas.HTTPRequest.methods.GET);
	req.addListener(listener);
	HTTPRequestQueue.add(req);
	//req.request( );
}

</script>
<div id="loading" class="classLoading" style="display: none;">
	Loading ...
</div>
<input type="button" name="makeRequest" value="doRequest" onClick="makeRequest()">
</script>
</body>
</html>